
<script>
export default {
  name: 'FileTypeSvgIcon',
  functional: true,
  props: {
    type: {
      type: Number,
      default: 127
    }
  },
  render(h, context) {
    const { type } = context.props
    const vnodes = []
    var icon = 'docFileTypeOther'
    if (type) {
      if (type === -7) {
        icon = 'docCatalogTypeEncryption'
      } else if (type === -8) {
        icon = 'docCatalogTypeFolder'
      } else if (type === 1) {
        icon = 'docFileTypeImage'
      } else if (type === 2) {
        icon = 'docFileTypeWord'
      } else if (type === 3) {
        icon = 'docFileTypeExcel'
      } else if (type === 4) {
        icon = 'docFileTypePPT'
      } else if (type === 5) {
        icon = 'docFileTypeTxt'
      } else if (type === 6) {
        icon = 'docFileTypeZip'
      } else if (type === 7) {
        icon = 'docFileTypePDF'
      } else if (type === 8) {
        icon = 'docFileTypeAudio'
      } else if (type === 9) {
        icon = 'docFileTypeVideo'
      } else {
        icon = 'docFileTypeOther'
      }
    }
    vnodes.push(<svg-icon icon-class={icon}/>)
    return vnodes
  }
}
</script>
<style lang="scss" scoped>
.svg-icon{
  width: 24px;
  height: 24px;
}
</style>
